home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / ljl.exe / PORTDIR.H < prev   
C/C++ Source or Header  |  1992-09-12  |  2KB  |  62 lines

  1.  
  2.  
  3. /***************************************************************************/
  4. /*                                                                         */
  5. /*           Copyright (c) 1990, Bob Withers                               */
  6. /*                                                                         */
  7. /*  Files to allow portable access to directory and file structure info    */
  8. /*  across MSDOS and OS/2 compilers.                                       */
  9. /*                                                                         */
  10. /***************************************************************************/
  11.  
  12. #ifndef PORTDIR_H
  13. #define PORTDIR_H
  14.  
  15. #include <time.h>
  16.  
  17. #define FILEATTR_NORMAL            0x00
  18. #define FILEATTR_RDONLY            0x01
  19. #define FILEATTR_HIDDEN            0x02
  20. #define FILEATTR_SYSTEM            0x04
  21. #define FILEATTR_LABEL             0x08
  22. #define FILEATTR_DIR               0x10
  23. #define FILEATTR_ARCH              0x20
  24.  
  25.  
  26. struct S_DirectEntry
  27. {
  28.     unsigned char   d_attr;
  29.     time_t          d_datetime;
  30.     unsigned long   d_filesize;
  31.     unsigned short  d_namlen;
  32.     char            d_name[13];
  33. };
  34. typedef struct S_DirectEntry        DIRECTENTRY;
  35.  
  36.  
  37. void *           DirOpen(char *pathname, unsigned uAttr);
  38. DIRECTENTRY *    DirRead(void *pHandle);
  39. void             DirClose(void *pHandle);
  40.  
  41.  
  42. /*  UNIX compatibility  */
  43.  
  44. #define DIRSIZ              64
  45.  
  46. typedef void                DIR;
  47.  
  48. struct dirent
  49. {
  50.     unsigned char   d_attr;
  51.     time_t          d_datetime;
  52.     unsigned long   d_filesize;
  53.     unsigned short  d_namlen;
  54.     char            d_name[13];
  55. };
  56.  
  57. DIR             *opendir(char *pathname);
  58. struct dirent   *readdir(DIR *pDir);
  59. void             closedir(DIR *pDir);
  60.  
  61. #endif
  62.